import {
    createStore
} from 'vuex'

const files =
    import.meta.globEager('./modules/*.js')

let modules = {};
Object.keys(files).forEach((item) => {
    const module = files[item].default;
    const moduleName = item.replace(/^\.\/(.*)\/(.*)\.\w+$/, '$2');
    modules[moduleName] = module;
});

export default createStore({
    modules: {
        ...modules
    }
})